Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update goshawk v0.1.17 changes #277

Merged
merged 3 commits into from
Jun 4, 2024
Merged

update goshawk v0.1.17 changes #277

merged 3 commits into from
Jun 4, 2024

Conversation

kartikeyakirar
Copy link
Contributor

part of : insightsengineering/goshawk#243

Exposed the dot_size argument in th_lineplot and th_spaghettiplot

Copy link
Contributor

github-actions bot commented Jun 2, 2024

CLA Assistant Lite bot ✅ All contributors have signed the CLA

@kartikeyakirar
Copy link
Contributor Author

kartikeyakirar commented Jun 2, 2024

I have read the CLA Document and I hereby sign the CLA

Copy link
Contributor

github-actions bot commented Jun 2, 2024

badge

Code Coverage Summary

Filename                                 Stmts    Miss  Cover    Missing
-------------------------------------  -------  ------  -------  ---------
R/tm_g_gh_boxplot.R                        353     353  0.00%    175-595
R/tm_g_gh_correlationplot.R                564     564  0.00%    227-898
R/tm_g_gh_density_distribution_plot.R      279     279  0.00%    135-464
R/tm_g_gh_lineplot.R                       566     566  0.00%    161-821
R/tm_g_gh_scatterplot.R                    246     246  0.00%    144-442
R/tm_g_gh_spaghettiplot.R                  316     316  0.00%    194-591
R/toggleable_slider.R                      155     155  0.00%    72-244
R/utils-arbitrary_lines.r                  126     126  0.00%    19-176
R/utils-data_constraints.r                 190     190  0.00%    2-257
R/utils-keep_range_slider_updated.r         23      23  0.00%    8-38
R/utils-maptrt.r                             9       9  0.00%    24-36
R/utils-templ_ui.r                          48      48  0.00%    2-73
R/utils.R                                   39      39  0.00%    12-83
R/zzz.R                                      2       2  0.00%    2-3
TOTAL                                     2916    2916  0.00%

Diff against main

Filename                     Stmts    Miss  Cover
-------------------------  -------  ------  --------
R/tm_g_gh_lineplot.R           +17     +17  +100.00%
R/tm_g_gh_spaghettiplot.R      +18     +18  +100.00%
TOTAL                          +35     +35  +100.00%

Results for commit: 28088a5

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

@npaszty
Copy link
Contributor

npaszty commented Jun 3, 2024

@kartikeyakirar

thanks for opening this PR. once it is merged I will test and then I think the release can be made so that we can upversion other study and data mart apps to the latest version ot teal and goshawk/teal.goshawk. thanks.

README.md Show resolved Hide resolved
Copy link
Contributor

@m7pr m7pr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kartikeyakirar left just one comment. other than that this is good to go

@kartikeyakirar kartikeyakirar enabled auto-merge (squash) June 4, 2024 08:59
@kartikeyakirar kartikeyakirar merged commit 9ace34a into main Jun 4, 2024
29 checks passed
@kartikeyakirar kartikeyakirar deleted the 243_goshawk_updates branch June 4, 2024 08:59
@github-actions github-actions bot locked and limited conversation to collaborators Jun 4, 2024
@kartikeyakirar
Copy link
Contributor Author

@npaszty PR is merged. You can install and check this.

@npaszty
Copy link
Contributor

npaszty commented Jun 4, 2024

@kartikeyakirar

I updated my renv environment to use version 0.1.15.9022. because of the following observations, I terminated the container I was testing in and started a new R 4.3.1 container but the observations below persisted.

I've noticed there are quite a few issues manifesting. I don't beleive these were in previous versions.

  1. the app appears to randomly close without writing an error to consol

  2. this dialog pops up when brushing data in the correlation plot.

image

  1. facet and split menu entries look like they are being correctly defined according to the documentation but the data set name appears in the menu. selecting it not surprisingly closes the app. here is the menu definition and the screen shot of the result.
    box_facet_vars <- c("ARM", "AVISITCD", "SEX")
    cs_box_facet_vars <- choices_selected(
    choices = variable_choices("ADLB", subset = box_facet_vars),
    selected = "AVISITCD"
    )
    image

line_splits <- c("SEX", "RACE")
cs_line_splits <- choices_selected(
choices = variable_choices("ADSL", subset = line_splits),
selected = NULL
)
image

  1. the LoQ symbol in the correlation plot appears to be applied to non LoQ values where the value displayed from brushing is 6 instead of 2 and the symbol in the visualization is being placed at 6 on the x-axis but should be at 2.
    image

using the data table and filtering to albumin and ALT the data in AVAL and the LOQFL flag value reflect correctly that the value for ALT should be placed at 2 on the x-axis.
image

@kartikeyakirar
Copy link
Contributor Author

kartikeyakirar commented Jun 5, 2024

@npaszty I tried to reproduce the mentioned error but was unable to do so. Since you are using the latest version, it should not be causing this issue. Could you please add session info ?

  1. the app appears to randomly close without writing an error to consol
  2. this dialog pops up when brushing data in the correlation plot.

no error or app crash. using below code.

sample app for `tm_g_gh_correlationplot`
# Example using ADaM structure analysis dataset.
data <- teal_data()
data <- within(data, {
  library(dplyr)
  library(stringr)

  # use non-exported function from goshawk
  h_identify_loq_values <- getFromNamespace("h_identify_loq_values", "goshawk")

  # original ARM value = dose value
  arm_mapping <- list(
    "A: Drug X" = "150mg QD",
    "B: Placebo" = "Placebo",
    "C: Combination" = "Combination"
  )
  color_manual <- c("150mg QD" = "#000000", "Placebo" = "#3498DB", "Combination" = "#E74C3C")
  # assign LOQ flag symbols: circles for "N" and triangles for "Y", squares for "NA"
  shape_manual <- c("N" = 1, "Y" = 2, "NA" = 0)

  set.seed(1)
  ADSL <- rADSL
  ADLB <- rADLB
  var_labels <- lapply(ADLB, function(x) attributes(x)$label)
  ADLB <- ADLB %>%
    mutate(AVISITCD = case_when(
      AVISIT == "SCREENING" ~ "SCR",
      AVISIT == "BASELINE" ~ "BL",
      grepl("WEEK", AVISIT) ~
        paste(
          "W",
          trimws(
            substr(
              AVISIT,
              start = 6,
              stop = str_locate(AVISIT, "DAY") - 1
            )
          )
        ),
      TRUE ~ NA_character_
    )) %>%
    mutate(AVISITCDN = case_when(
      AVISITCD == "SCR" ~ -2,
      AVISITCD == "BL" ~ 0,
      grepl("W", AVISITCD) ~ as.numeric(gsub("[^0-9]*", "", AVISITCD)),
      TRUE ~ NA_real_
    )) %>%
    # use ARMCD values to order treatment in visualization legend
    mutate(TRTORD = ifelse(grepl("C", ARMCD), 1,
      ifelse(grepl("B", ARMCD), 2,
        ifelse(grepl("A", ARMCD), 3, NA)
      )
    )) %>%
    mutate(ARM = as.character(arm_mapping[match(ARM, names(arm_mapping))])) %>%
    mutate(ARM = factor(ARM) %>%
      reorder(TRTORD)) %>%
    mutate(
      ANRHI = case_when(
        PARAMCD == "ALT" ~ 60,
        PARAMCD == "CRP" ~ 70,
        PARAMCD == "IGA" ~ 80,
        TRUE ~ NA_real_
      ),
      ANRLO = case_when(
        PARAMCD == "ALT" ~ 20,
        PARAMCD == "CRP" ~ 30,
        PARAMCD == "IGA" ~ 40,
        TRUE ~ NA_real_
      )
    ) %>%
    rowwise() %>%
    group_by(PARAMCD) %>%
    mutate(LBSTRESC = ifelse(
      USUBJID %in% sample(USUBJID, 1, replace = TRUE),
      paste("<", round(runif(1, min = 25, max = 30))), LBSTRESC
    )) %>%
    mutate(LBSTRESC = ifelse(
      USUBJID %in% sample(USUBJID, 1, replace = TRUE),
      paste(">", round(runif(1, min = 70, max = 75))), LBSTRESC
    )) %>%
    ungroup()
  attr(ADLB[["ARM"]], "label") <- var_labels[["ARM"]]
  attr(ADLB[["ANRHI"]], "label") <- "Analysis Normal Range Upper Limit"
  attr(ADLB[["ANRLO"]], "label") <- "Analysis Normal Range Lower Limit"

  # add LLOQ and ULOQ variables
  ADLB_LOQS <- h_identify_loq_values(ADLB, "LOQFL")
  ADLB <- left_join(ADLB, ADLB_LOQS, by = "PARAM")
})

datanames <- c("ADSL", "ADLB")
datanames(data) <- datanames

join_keys(data) <- default_cdisc_join_keys[datanames]

app <- init(
  data = data,
  modules = modules(
    tm_g_gh_correlationplot(
      label = "Correlation Plot",
      dataname = "ADLB",
      param_var = "PARAMCD",
      xaxis_param = choices_selected(c("ALT", "CRP", "IGA"), "ALT"),
      yaxis_param = choices_selected(c("ALT", "CRP", "IGA"), "CRP"),
      xaxis_var = choices_selected(c("AVAL", "BASE", "CHG", "PCHG"), "BASE"),
      yaxis_var = choices_selected(c("AVAL", "BASE", "CHG", "PCHG"), "AVAL"),
      trt_group = choices_selected(c("ARM", "ACTARM"), "ARM"),
      color_manual = c(
        "Drug X 100mg" = "#000000",
        "Placebo" = "#3498DB",
        "Combination 100mg" = "#E74C3C"
      ),
      shape_manual = c("N" = 1, "Y" = 2, "NA" = 0),
      plot_height = c(500, 200, 2000),
      facet_ncol = 2,
      visit_facet = TRUE,
      reg_line = FALSE,
      loq_legend = TRUE,
      font_size = c(12, 8, 20),
      dot_size = c(1, 1, 12),
      reg_text_size = c(3, 3, 10),
      hline_arb = c(40, 50),
      hline_arb_label = "arb hori label",
      hline_arb_color = c("red", "blue"),
      hline_vars = c("ANRHI", "ANRLO", "ULOQN", "LLOQN"),
      hline_vars_colors = c("green", "blue", "purple", "cyan"),
      hline_vars_labels = c("ANRHI Label", "ANRLO Label", "ULOQN Label", "LLOQN Label"),
      vline_vars = c("ANRHI", "ANRLO", "ULOQN", "LLOQN"),
      vline_vars_colors = c("yellow", "orange", "brown", "gold"),
      vline_vars_labels = c("ANRHI Label", "ANRLO Label", "ULOQN Label", "LLOQN Label"),
      vline_arb = c(50, 70),
      vline_arb_label = "arb vert A",
      vline_arb_color = c("green", "orange")
    )
  )
)
if (interactive()) {
  shinyApp(app$ui, app$server)
}

3:facet and split menu entries look like they are being correctly defined according to the

I checked boxplot and lineplot . did not find dataset name.

sample app for `tm_g_gh_boxplot`
# Example using ADaM structure analysis dataset.
data <- teal_data()
data <- within(data, {
  library(dplyr)
  library(nestcolor)
  library(stringr)

  # use non-exported function from goshawk
  h_identify_loq_values <- getFromNamespace("h_identify_loq_values", "goshawk")

  # original ARM value = dose value
  arm_mapping <- list(
    "A: Drug X" = "150mg QD",
    "B: Placebo" = "Placebo",
    "C: Combination" = "Combination"
  )
  set.seed(1)
  ADSL <- rADSL
  ADLB <- rADLB
  var_labels <- lapply(ADLB, function(x) attributes(x)$label)
  ADLB <- ADLB %>%
    mutate(
      AVISITCD = case_when(
        AVISIT == "SCREENING" ~ "SCR",
        AVISIT == "BASELINE" ~ "BL",
        grepl("WEEK", AVISIT) ~ paste("W", str_extract(AVISIT, "(?<=(WEEK ))[0-9]+")),
        TRUE ~ as.character(NA)
      ),
      AVISITCDN = case_when(
        AVISITCD == "SCR" ~ -2,
        AVISITCD == "BL" ~ 0,
        grepl("W", AVISITCD) ~ as.numeric(gsub("[^0-9]*", "", AVISITCD)),
        TRUE ~ as.numeric(NA)
      ),
      AVISITCD = factor(AVISITCD) %>% reorder(AVISITCDN),
      TRTORD = case_when(
        ARMCD == "ARM C" ~ 1,
        ARMCD == "ARM B" ~ 2,
        ARMCD == "ARM A" ~ 3
      ),
      ARM = as.character(arm_mapping[match(ARM, names(arm_mapping))]),
      ARM = factor(ARM) %>% reorder(TRTORD),
      ACTARM = as.character(arm_mapping[match(ACTARM, names(arm_mapping))]),
      ACTARM = factor(ACTARM) %>% reorder(TRTORD),
      ANRLO = 50,
      ANRHI = 75
    ) %>%
    rowwise() %>%
    group_by(PARAMCD) %>%
    mutate(LBSTRESC = ifelse(
      USUBJID %in% sample(USUBJID, 1, replace = TRUE),
      paste("<", round(runif(1, min = 25, max = 30))), LBSTRESC
    )) %>%
    mutate(LBSTRESC = ifelse(
      USUBJID %in% sample(USUBJID, 1, replace = TRUE),
      paste(">", round(runif(1, min = 70, max = 75))), LBSTRESC
    )) %>%
    ungroup()

  attr(ADLB[["ARM"]], "label") <- var_labels[["ARM"]]
  attr(ADLB[["ACTARM"]], "label") <- var_labels[["ACTARM"]]
  attr(ADLB[["ANRLO"]], "label") <- "Analysis Normal Range Lower Limit"
  attr(ADLB[["ANRHI"]], "label") <- "Analysis Normal Range Upper Limit"

  # add LLOQ and ULOQ variables
  ALB_LOQS <- h_identify_loq_values(ADLB, "LOQFL")
  ADLB <- left_join(ADLB, ALB_LOQS, by = "PARAM")
})

datanames <- c("ADSL", "ADLB")
datanames(data) <- datanames

join_keys(data) <- default_cdisc_join_keys[datanames]

app <- init(
  data = data,
  modules = modules(
    tm_g_gh_boxplot(
      label = "Box Plot",
      dataname = "ADLB",
      param_var = "PARAMCD",
      param = choices_selected(c("ALT", "CRP", "IGA"), "ALT"),
      yaxis_var = choices_selected(c("AVAL", "BASE", "CHG"), "AVAL"),
      xaxis_var = choices_selected(c("ACTARM", "ARM", "AVISITCD", "STUDYID"), "ARM"),
      facet_var = choices_selected(c("ACTARM", "ARM", "AVISITCD", "SEX"), "AVISITCD"),
      trt_group = choices_selected(c("ARM", "ACTARM"), "ARM"),
      loq_legend = TRUE,
      rotate_xlab = FALSE,
      hline_arb = c(60, 55),
      hline_arb_color = c("grey", "red"),
      hline_arb_label = c("default_hori_A", "default_hori_B"),
      hline_vars = c("ANRHI", "ANRLO", "ULOQN", "LLOQN"),
      hline_vars_colors = c("pink", "brown", "purple", "black"),
    )
  )
)
if (interactive()) {
  shinyApp(app$ui, app$server)
}

using line tm_g_gh_lineplot example.
image

4:the LoQ symbol in the correlation plot appears to be applied to non LoQ values where the value displayed from brushing is 6 instead of 2 and the symbol in the visualization is being placed at 6 on the x-axis but should be at 2.

using above tm_g_gh_correlationplot ` example. here I produced the image and it shows LaQ value at correct place on xaxis.
image

session info

R version 4.3.1 (2023-06-16 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 11 x64 (build 22631)

Matrix products: default


locale:
[1] LC_COLLATE=English_India.utf8  LC_CTYPE=English_India.utf8    LC_MONETARY=English_India.utf8
[4] LC_NUMERIC=C                   LC_TIME=English_India.utf8    

time zone: Asia/Calcutta
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] nestcolor_0.1.2.9010      stringr_1.5.1             teal.goshawk_0.1.15.9022 
 [4] teal.transform_0.5.0.9004 teal_0.15.2.9037          teal.slice_0.5.0.9013    
 [7] teal.data_0.6.0.9000      teal.code_0.5.0.9004      shiny_1.8.0              
[10] goshawk_0.1.17.9001       dplyr_1.1.3              

loaded via a namespace (and not attached):
 [1] shinyvalidate_0.1.3      gtable_0.3.5             xfun_0.43               
 [4] bslib_0.7.0              ggplot2_3.5.1            shinyjs_2.1.0           
 [7] htmlwidgets_1.6.4        teal.widgets_0.4.2.9011  vctrs_0.6.3             
[10] tools_4.3.1              crosstalk_1.2.1          generics_0.1.3          
[13] parallel_4.3.1           tibble_3.2.1             fansi_1.0.4             
[16] pkgconfig_2.0.3          checkmate_2.2.0          ggnewscale_0.4.10       
[19] lifecycle_1.0.4          compiler_4.3.1           farver_2.1.1            
[22] textshaping_0.3.7        munsell_0.5.1            fontawesome_0.5.2       
[25] httpuv_1.6.11            shinyWidgets_0.8.6       htmltools_0.5.8.1       
[28] sass_0.4.9               yaml_2.3.8               later_1.3.1             
[31] pillar_1.9.0             jquerylib_0.1.4          tidyr_1.3.0             
[34] robslopes_1.1.3          ellipsis_0.3.2           DT_0.33                 
[37] cachem_1.0.8             mime_0.12                mcr_1.3.3               
[40] tidyselect_1.2.1         digest_0.6.33            stringi_1.7.12          
[43] colourpicker_1.3.0       purrr_1.0.2              labeling_0.4.3          
[46] cowplot_1.1.3            fastmap_1.1.1            grid_4.3.1              
[49] colorspace_2.1-0         cli_3.6.1                logger_0.3.0            
[52] magrittr_2.0.3           utf8_1.2.3               withr_3.0.0             
[55] teal.reporter_0.3.1.9005 scales_1.3.0             promises_1.2.1          
[58] backports_1.4.1          rmarkdown_2.26           ragg_1.3.1              
[61] memoise_2.0.1            evaluate_0.23            knitr_1.46              
[64] shinycssloaders_1.0.0    miniUI_0.1.1.1           rlang_1.1.1             
[67] Rcpp_1.0.11              xtable_1.8-4             glue_1.6.2              
[70] formatR_1.14             rstudioapi_0.15.0        jsonlite_1.8.7          
[73] teal.logger_0.2.0.9002   R6_2.5.1                 systemfonts_1.0.6  

@npaszty
Copy link
Contributor

npaszty commented Jun 5, 2024

@kartikeyakirar

here is my session info. I wonder if the delayed data load environment might be causing differences. we have to use delayed data loading but the sample apps don't. I looked at the syntax for the populating menu content in delyaed data loading and the syntax I'm using appears correct. I tried to revert to the previous version but got an error that the previous version no longer exists in the repository. I'm sure that's probably wrong so I could sort that. thought this would be helpfull to do as comparison.

Do you have an OCEAN account? if so then it would be best for you to work in the exact same environment we are working in. the study data are from an open small legacy study and the data folder in our branch contains a symlink to the data so you should be able to run the app locally in the same environment we are running it.

> sessionInfo()
R version 4.3.1 (2023-06-16)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.3 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so;  LAPACK version 3.10.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

time zone: Etc/UTC
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices datasets  utils     methods   base     

other attached packages:
 [1] tidyr_1.3.1                 teal.goshawk_0.1.15.9022    teal.modules.general_0.3.0  ggmosaic_0.3.3              ggplot2_3.5.0              
 [6] teal.modules.clinical_0.9.0 tern_0.9.3                  rtables_0.6.6               formatters_0.5.5            teal.transform_0.5.0       
[11] teal.connectors.rice_0.2.0  teal_0.15.2                 teal.slice_0.5.0            teal.data_0.5.0             teal.code_0.5.0            
[16] stringr_1.5.1               sparkline_2.0               ricepass_1.1.4              rice_3.0.1                  magrittr_2.0.3             
[21] goshawk_0.1.17.9001         dplyr_1.1.4                 googlesheets4_1.0.1         DescTools_0.99.54           shiny_1.8.1.1              

loaded via a namespace (and not attached):
  [1] rstudioapi_0.16.0     jsonlite_1.8.8        estimability_1.5      farver_2.1.1          rmarkdown_2.26        ragg_1.2.7            geepack_1.3.10       
  [8] fs_1.6.3              vctrs_0.6.5           memoise_2.0.1         askpass_1.2.0         htmltools_0.5.8.1     forcats_1.0.0         curl_5.2.1           
 [15] haven_2.5.4           broom_1.0.5           cellranger_1.1.0      sass_0.4.9            bslib_0.7.0           htmlwidgets_1.6.4     fontawesome_0.5.2    
 [22] emmeans_1.10.0        rootSolve_1.8.2.4     plotly_4.10.4         cachem_1.0.8          mime_0.12             lifecycle_1.0.4       teal.widgets_0.4.2   
 [29] pkgconfig_2.0.3       Matrix_1.6-1.1        R6_2.5.1              fastmap_1.1.1         rbibutils_2.2.16      digest_0.6.35         Exact_3.2            
 [36] colorspace_2.1-0      shinycssloaders_1.0.0 textshaping_0.3.7     crosstalk_1.2.1       labeling_0.4.3        fansi_1.0.6           httr_1.4.7           
 [43] compiler_4.3.1        gargle_1.2.1          proxy_0.4-27          withr_3.0.0           backports_1.4.1       logger_0.3.0          MASS_7.3-60.0.1      
 [50] openssl_2.1.1         gld_2.6.6             tools_4.3.1           robslopes_1.1.3       googledrive_2.0.0     httpuv_1.6.15         shinyvalidate_0.1.3  
 [57] glue_1.7.0            nlme_3.1-163          promises_1.2.1        grid_4.3.1            rsconnect_1.2.2       checkmate_2.3.1       generics_0.1.3       
 [64] gtable_0.3.4          tzdb_0.4.0            class_7.3-22          data.table_1.15.4     lmom_3.0              hms_1.1.3             utf8_1.2.4           
 [71] ggrepel_0.9.5         pillar_1.9.0          later_1.3.2           splines_4.3.1         tern.gee_0.1.3        lattice_0.21-9        renv_1.0.3           
 [78] survival_3.5-7        tidyselect_1.2.1      knitr_1.45            teal.logger_0.2.0     xfun_0.43             expm_0.999-9          DT_0.33              
 [85] stringi_1.8.3         lazyeval_0.2.2        yaml_2.3.8            boot_1.3-29           shinyWidgets_0.8.4    evaluate_0.23         tibble_3.2.1         
 [92] cli_3.6.1             systemfonts_1.0.6     xtable_1.8-4          Rdpack_2.6            munsell_0.5.1         jquerylib_0.1.4       Rcpp_1.0.12          
 [99] teal.reporter_0.3.1   readxl_1.4.3          parallel_4.3.1        readr_2.1.5           assertthat_0.2.1      mcr_1.3.3             viridisLite_0.4.2    
[106] mvtnorm_1.2-4         scales_1.3.0          e1071_1.7-14          purrr_1.0.2           rlang_1.1.3       -    shinyjs_2.1.0        

@npaszty
Copy link
Contributor

npaszty commented Jun 5, 2024

@kartikeyakirar

I changed the data flow to remove the read from entimICE that necesitated our use of delayed data loading. the data are now read from the file system but both the menu and the incorrect placement of values in the correlation plot issue persist.

hopefully you can access OCEAN and help test this out in the study data context. I will keep plugging away at to see if this is a data issue vs. package issue.

it would be great to be able to sort this out quickly as we have been working for many weeks on upversioning this app. thanks!

@kartikeyakirar
Copy link
Contributor Author

@npaszty I have an OCEAN account and this is my @kirark GitHub and GitLab username. You can provide access to it. I will look at the app code in the OCEAN environment and debug the issue.

@npaszty
Copy link
Contributor

npaszty commented Jun 5, 2024

@kartikeyakirar

you already have access to the repo and you should have access to the data as well since it is an open legacy study.
please use OCEAN PROD FSX and an R 4.3.1 container.

I also see the same issue of including the data name in menues of the ARM variable which is in every module. I tried different menu creation approaches per variable_choices() docs but only one that works is the one documented for the delayed data loading environment. there is one menu that is built the same way but does not include the data name so this is a real mystery. maybe I'm missing something obvious.

image

the one that works is in box plot
image

here is the configuration of that menu which as far as I can tell is the same as the others that include the data name.

box_xaxis_vars <- c("ARM", "AVISITCD", "STUDYID")

cs_box_xaxis_vars <- choices_selected(
  choices = variable_choices("ADLB", subset = box_xaxis_vars),
  selected = "ARM"
)

@npaszty
Copy link
Contributor

npaszty commented Jun 5, 2024

@kartikeyakirar

seems like the menu item that works has a different configuration in the module code than the ones that include the data name

     uiOutput(ns("axis_selections")), # this menu content is correct
      teal.widgets::optionalSelectInput( # this menu content is incorrect
        ns("facet_var"),
        label = "Facet by",
        choices = a$facet_var$choices,
        selected = a$facet_var$selected,
        multiple = FALSE
      ),

@kartikeyakirar
Copy link
Contributor Author

I wonder if the delayed data load environment might be causing differences. we have to use delayed data loading but the sample apps don't. I looked at the syntax for the populating menu content in delyaed data loading

@npaszty, Yes, I tested this with examples where delayed data was not passed.

  • Currently, defining widgets in the UI and passing delayed data is causing an issue. I fixed this by extracting choices from the delayed_data and have raised a PR to address it: [Bug]: Misleading dataset name display in dropdown menus #271.

  • if, when delayed data is passed, Do we need to resolve it before creating the widget? In that case, we would need to move all the widgets to the server logic and use renderUI to handle the delayed data there.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants